//
//  DTFrameworkInterface+industry.m
//  industry
//
//  Created by xl on 2020/11/10. All rights reserved.
//

#import "DTFrameworkInterface+industry.h"
#import "MPBootLoaderImpl.h"
#import "YQH5WebViewController.h"
#import "YQAppletLoadingView.h"
#import <TinyappService/TASUtils.h>
#import "MPUtils.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"

@implementation DTFrameworkInterface (industry)

- (BOOL)shouldLogReportActive
{
    return YES;
}

- (NSTimeInterval)logReportActiveMinInterval
{
    return 0;
}

- (BOOL)shouldLogStartupConsumption
{
    return YES;
}

- (BOOL)shouldAutoactivateBandageKit
{
    return YES;
}

- (BOOL)shouldAutoactivateShareKit
{
    return YES;
}

- (DTNavigationBarBackTextStyle)navigationBarBackTextStyle
{
    return DTNavigationBarBackTextStyleNone;
}

- (void)application:(UIApplication *)application beforeDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //方法一：初始化容器(在线请求)
    //[MPNebulaAdapterInterface initNebula];
    NSString *pluginsJsapisPath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"Extra_Config.plist"] ofType:nil];
    [MPNebulaAdapterInterface initNebulaWithCustomPresetApplistPath:@"" customPresetAppPackagePath:@"" customPluginsJsapisPath:pluginsJsapisPath];
}

- (void)application:(UIApplication *)application afterDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //定制容器
    //全局开启 WKWebview 开关
    [MPNebulaAdapterInterface shareInstance].nebulaUseWKArbitrary = YES;
    [MPNebulaAdapterInterface shareInstance].nebulaNeedVerify = NO;
    [MPNebulaAdapterInterface shareInstance].nebulaVeiwControllerClass = [YQH5WebViewController class];
    [MPNebulaAdapterInterface shareInstance].nebulaUserAgent = @"mPaaS/Portal";
    // 出现小程序未更新现象；这里将自动更新时间由原来的3600缩短为300
    [MPNebulaAdapterInterface shareInstance].nebulaUpdateReqRate = 300;
    // 全量更新离线包
//    [[MPNebulaAdapterInterface shareInstance] requestAllNebulaApps:^(NSDictionary *data, NSError *error) {
//    }];
    // 工具类初始化
    [MPUtils shareInstance];

}



- (DTBootLoader *)bootLoader {
    static MPBootLoaderImpl *_bootLoader;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _bootLoader = [[MPBootLoaderImpl alloc] init];
    });
    return _bootLoader;
}

- (BOOL)shouldWindowMakeVisable {
    return NO;
}

- (BOOL)shouldShowLauncher {
    return NO;
}

- (NSString *)baseloadViewClass
 {
     return @"YQAppletLoadingView";
 }

@end

#pragma clang diagnostic pop

